package com.tc.shiro.repository;

import com.tc.shiro.entity.PortalOperator;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface PortalOperatorRepository {

	int deleteByPrimaryKey(Long id);

	PortalOperator selectByPrimaryKey(Long id);

	int updateByPrimaryKey(PortalOperator portalOperator);

	int updateByPrimaryKeySelective(PortalOperator portalOperator);

	int insert(PortalOperator portalOperator);

	int insertSelective(PortalOperator portalOperator);

	int selectCount(PortalOperator portalOperator);

	List<PortalOperator> selectPage(@Param("portalOperator") PortalOperator portalOperator,
                                    @Param("pageable") Pageable pageable);

	PortalOperator selectByOperator(PortalOperator portalOperator);

	List<PortalOperator> selectOperatorManage(@Param("portalOperator") PortalOperator portalOperator,
                                              @Param("pageable") Pageable pageable);

	List<PortalOperator> selectByMercNo(PortalOperator portalOperator);

	int updatePwd(@Param("operator") String operator, @Param("pwd") String pwd);

	int updatePwdAndStatus(@Param("operatorNo") String operatorNo, @Param("operator") String operator,@Param("pwd") String pwd, @Param("operatorStatus") String operatorStatus);

	int updateFailNum(@Param("id") long id, @Param("wrongPwdCount") int wrongPwdCount,@Param("operatorStatus") String operatorStatus);

	int updateStatus(@Param("id") long id, @Param("operatorStatus") String operatorStatus);

	int updateLoginSuccess(@Param("operator") String operator, @Param("customerIp") String customerIp);

	int updateByOperatorNo(PortalOperator portalOperator);

	int updateByRoleMercNo(PortalOperator portalOperator);

	List<PortalOperator> selectOperatorManageSec(@Param("portalOperator") PortalOperator portalOperator,@Param("pageable") Pageable pageable);

	int selectCountByRoleMercNo(PortalOperator portalOperator);

	int activeAdmin(@Param("portalOperator") PortalOperator portalOperator);

	int updateByDeleteRole(PortalOperator portalOperator);

	List<PortalOperator> selectOperatorList(PortalOperator portalOperator);

	int selectCountByMobile(PortalOperator portalOperator);
	
	int setReserveInfo(@Param("operator") String operator, @Param("reserveInfo") String reserveInfo);
}